package com.gopay.common.core.dic.dao.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.core.dic.dao.DicPayChannelDAO;
import com.gopay.common.domain.dic.DicPayChannel;

/**
 * 交易类型字段表dao
 * @DicTransTypeDAOImpl.java
 * @author liujy
 * @2013-4-8 下午2:31:23  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("dicPayChannelDAO")
public class DicPayChannelDAOImpl extends BaseDAOImpl<DicPayChannel, Serializable> implements DicPayChannelDAO{

    @Override
    public List<DicPayChannel> findDisplayChannel() {
        String hql = "from DicPayChannel d where d.displayFlag=:displayFlag and d.delFlag=:delFlag";
        Map<String, Object> param = new HashMap<String, Object>();
        param.put("displayFlag", 1);
        param.put("delFlag", 0);
        return findByHql(hql, param);
    }

    @Override
    public List<DicPayChannel> findChannelByCodes(List<String> codes) {
        String hql = "from DicPayChannel d where d.code in (:codes)";
        Map<String, Object> param = new HashMap<String, Object>();
        return findByHql(hql, param);
    }
}